leptonica: add package
authorValentín Kivachuk <[email protected]>
Sun, 14 Jul 2019 15:45:10 +0000 (17:45 +0200)
committerValentín Kivachuk <[email protected]>
Sun, 14 Jul 2019 15:45:10 +0000 (17:45 +0200)
Leptonica is an open source library containing software that is broadly useful for image processing and image analysis applications.

Signed-off-by: Valentín Kivachuk <[email protected]>
libs/leptonica/Makefile [new file with mode: 0644]

diff --git a/libs/leptonica/Makefile b/libs/leptonica/Makefile
new file mode 100644 (file)
index 0000000..4c55319
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2019 Valentín Kivachuk <[email protected]>
+#
+# This is free software, licensed under the GNU General Public License v3.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=leptonica
+PKG_VERSION:=1.78.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.leptonica.org/source/
+PKG_HASH:=e2ed2e81e7a22ddf45d2c05f0bc8b9ae7450545d995bfe28517ba408d14a5a88
+
+PKG_MAINTAINER:=Valentín Kivachuk <[email protected]>
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=leptonica-license.txt
+
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libleptonica
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A library for efficient image processing and image analysis operations
+  URL:=http://www.leptonica.org/
+  DEPENDS:=+giflib +libjpeg +libpng +libtiff +zlib
+endef
+
+TARGET_CFLAGS:=$(filter-out -O%,$(TARGET_CFLAGS)) -O3
+TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/leptonica $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblept.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lept.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libleptonica/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblept.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libleptonica))